package com.dragon.account.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dragon.account.entity.MpProduct;
import com.dragon.account.repository.MpProductRepository;
import com.dragon.common.repository.mybatis.paginator.domain.PageBounds;
import com.dragon.common.service.BaseService;

/**
 * @author hanchaoyong
 */
@Service
public class MpProductService extends BaseService<MpProduct, Long> {
	
	@Autowired
	private MpProductRepository mpProductRepository;
	
	public List<Map<String,Object>> selectProductInfoList(){
		return mpProductRepository.selectProductInfoList();
	}
	
	public List<Map<String,Object>> selectProductInfoList(PageBounds pageBounds){
		return mpProductRepository.selectProductInfoList(pageBounds);
	}
	
	public Map<String,Object> selectProductInfo(Long productId){		
		return mpProductRepository.selectProductInfo(productId);
	}
	
	public List<Integer> selectProductTenor(String productType){
		return mpProductRepository.selectProductTenor(productType);
	}
	
    public BigDecimal selectProduceRate(Long productId){
    	return mpProductRepository.selectProduceRate(productId);
    }

    public Map<String, BigDecimal> selectProductRateMap(Long productId){
		return mpProductRepository.selectProductRateMap(productId);
	}
	
	public BigDecimal selectConsultingFee(Long productId){
		return mpProductRepository.selectConsultingFee(productId);
	}
	
	public BigDecimal selectAdministrativeFee(Long productId){
		return mpProductRepository.selectAdministrativeFee(productId);
	}
	
	public List<Map<String,Object>> selectProductTypeList(){
		return mpProductRepository.selectProductTypeList();
	}

	public List<Map<String,Object>> selectProductTypeListByPatternType(String patternType){
		return mpProductRepository.selectProductTypeListByPatternType(patternType);
	}
	
	public List<Map<String,Object>> selectProductTypeListOrderByAscByPatternType(String patternType){
		return mpProductRepository.selectProductTypeListOrderByAscByPatternType(patternType);
	}
	
	
	public List<Map<String,Object>> selectProductAllByPatternType(String patternType){
		return mpProductRepository.selectProductAllByPatternType(patternType);
	}
	/*根据编号查询产品大类数据*/
	public Map<String,Object> selectProductTypeById(Long productTypeId){
		return mpProductRepository.selectProductTypeById(productTypeId);
	}
	
}
